package org.getOffer.offer03;

/**
 * @Author: wjy
 * @Date: 2021/9/23 13:46
 */
public class Solution {

    public static void main(String[] args) {

        int[] nums = {2, 3, 1, 0, 2, 5, 3};

        System.out.println(findRepeatNumber(nums));

    }

    public static int findRepeatNumber(int[] nums) {

        int[] arrays = new int[nums.length];

        for (int i : nums) {
            if (arrays[i] != 0) {
                return i;
            }
            arrays[i]++;
        }
        return 0;
    }

}
